#include<iostream>
using namespace std;
#include<vector>

int findMin(vector<int>& nums) {
    int length = nums.size();
    int right = length;
    int left = 0;
    int middle = (left + right) / 2;
    if (length == 1)
    {
        return nums[0];
    }
    if (length == 2)
    {
        if (nums[0] < nums[1])
        {
            return nums[0];
        }
        return nums[1];
    }

    while (nums[middle] > nums[middle + 1] || nums[middle] > nums[middle - 1])
    {
        middle = (left + right) / 2;
        if (middle == 0 || middle == length - 1)
            break;
        if (nums[middle] > nums[middle - 1])
        {
            if (nums[middle] > nums[length-1])
            {
                left = middle;
            }
            else
            {
                right = middle;
            }
        }

    }
    return nums[middle];
}

int main()
{
    vector<int> nums = { 11};
    cout<<findMin(nums)<<endl;
	return 0;
}